<template>
  <div id="app">
      <h1 v-text='$store.state.count'></h1>
      <button @click="add">加</button>
      <button @click="sub">减</button>
      <button @click="asyncAdd">一秒后加</button> 
      <h1>{{evenOrOdd}}</h1>
  </div>
</template>
    
<script>
  import { mapActions,mapGetters } from 'vuex'
  export default{
    name: 'App',
    computed:{
      ...mapGetters([
        'evenOrOdd'
      ])
    },
    methods:{
      ...mapActions([
        'add', 
        'sub',
        'asyncAdd'
    ])
    }
  }
</script>

<style>

</style>
